package xiegd.com.springbootuse.demo.beanDemo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author: xieguangda
 * @Description:
 * @Date: 2023/9/14 17:21
 */
public class MyBeanTest {
    public static void main(String[] args) {

        //XmlBeanFactory factory = new XmlBeanFactory(new ClassPathResource("myProperties.xml"));
        ApplicationContext context = new ClassPathXmlApplicationContext("myProperties.xml");
        MyBean config = (MyBean) context.getBean("myBean");
        System.out.println(config.getName()); // 输出 "Hello, World!"
    }
}
